<?php

namespace App\Http\Requests;

class Reply extends BaseRequest
{

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'user_id'   => 'required|numeric',
            'to_user'   => 'numeric',
            'content'   => 'required|string|min:6|max:150'
        ];
    }

    /**
     * 获取验证错误的自定义属性
     *
     * @return array
     */
    public function attributes()
    {
        return [
            'content' => '回复内容'
        ];
    }

    /**
     * 获取已定义验证规则的错误消息
     *
     * @return array
     */
    public function messages()
    {
        return [
            'content.min' => '回复内容不能少于6个字符',
            'content.max' => '回复内容不能多于150个字符',
        ];
    }

}
